<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                template="/template_content_admin.xhtml">

<ui:define name="conteudo">
    <h2>Adicionar Funcionário</h2>
    <h:panelGroup id="messagePanel" layout="block">
            <h:messages errorClass="messagesErro" infoClass="messagesInfo" layout="table"/>
    </h:panelGroup>
    <h:form>
       <h:panelGrid columns="2" columnClasses="panelgridClass1, panelgridClass2">
            <f:facet name="header">
                <h:outputText value="Alocs! :)"/>
            </f:facet>
                    <h:outputText value="CPF:"/>
                    <h:inputText styleClass="try" id="cpf" value="#{funcionario.funcionario.cpf}" title="Cpf" required="true" requiredMessage="The cpf field is required." />
                    <h:outputText value="RG:"/>
                    <h:inputText styleClass="try" id="rg" value="#{funcionario.funcionario.rg}" title="Rg" required="true" requiredMessage="The rg field is required." />
                    <h:outputText value="CTPS:"/>
                    <h:inputText styleClass="try" id="ctps" value="#{funcionario.funcionario.ctps}" title="Ctps" required="true" requiredMessage="The ctps field is required." />
                    <h:outputText value="#{msg['rua']}:"/>
                    <h:inputText styleClass="try" id="endRua" value="#{funcionario.funcionario.endRua}" title="EndRua" />
                    <h:outputText value="#{msg['bairro']}:"/>
                    <h:inputText styleClass="try" id="endBairro" value="#{funcionario.funcionario.endBairro}" title="EndBairro" />
                    <h:outputText value="#{msg['cidade']}"/>
                    <h:inputText styleClass="try" id="endCidade" value="#{funcionario.funcionario.endCidade}" title="EndCidade" />
                    <h:outputText value="#{msg['cep']}:"/>
                    <h:inputText styleClass="try" id="endCep" value="#{funcionario.funcionario.endCep}" title="EndCep" />
                    <h:outputText value="#{msg['uf']}"/>
                    <h:inputText styleClass="try" id="endUf" value="#{funcionario.funcionario.endUf}" title="EndUf" />
                    <h:outputText value="#{msg['salario']}:"/>
                    <h:inputText styleClass="try" id="salario" value="#{funcionario.funcionario.salario}" title="Salario" required="true" requiredMessage="The salario field is required." />
                    <h:outputText value="#{msg['nome']}:"/>
                    <h:inputText styleClass="try" id="nome" value="#{funcionario.funcionario.nome}" title="Nome" required="true" requiredMessage="The nome field is required." />
                    <h:outputText value="#{msg['nome_cargo']}"/>

                    <h:selectOneMenu value="#{funcionario.funcionario.idCargo}"  >
                        <c:forEach items="#{cargo.listCargos}" var="item">
                            <f:selectItem itemValue="#{item.id}" itemLabel="#{item.cargo}"/>
                            <f:converter converterId ="converterCargos" />
                        </c:forEach>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:panelGrid columns="2">
                    <h:commandButton id="add" styleClass="buttonK" value="#{msg['adicionar']}" action="#{funcionario.create}"/>
                    <h:commandButton id="list" styleClass="buttonK" value="#{msg['listar']}" action="#{funcionario.listarFuncionarios}" immediate="true"/>
                </h:panelGrid>
    </h:form>
    </ui:define>

</ui:composition>
